#ifndef _MEMBER_BSPLITBUTTON_H_
#define _MEMBER_BSPLITBUTTON_H_

#include <BLine2>
#include <BRect>
#include <BStyle>
#include "ILineBlock.h"
#include "ISplitBoard.h"
#include "IAlignment.h"

#define splitbutton_member(splitbutton)		((member_BSplitButton*)((BSplitButton*)splitbutton)->_ptr)

namespace BWE
{
	class member_BSplitButton : public BObject
	{
		friend class BSplitButton;
	public:
		member_BSplitButton(BSplitButton* splitbutton);
		~member_BSplitButton();

		void freshRects();

		void slotArrowChecked(BObject* object, const BValue& value);

		void slotBoardClicked(BObject* object, const BValue& value);
		void slotBoardStyled(BObject* object, const BValue& value);

		void slotItemColorChanged(BObject* object, const BValue& vaue);
		void slotItemGraphChanged(BObject* object, const BValue& vaue);
		void slotItemImageChanged(BObject* object, const BValue& vaue);
		void slotItemIconChanged(BObject* object, const BValue& vaue);
		void slotItemValueChanged(BObject* object, const BValue& vaue);
		void slotItemTextChanged(BObject* object, const BValue& value);

		BSplitButton*		boss;
		bool				exclusive;
		bool				readOnly;
		BSize				arrowSize;
		Part				arrowPart;
		Align				arrowAlign;
		BSplitItem*			current;
		BValue				value;

		bool				dirty;
		BHolder<BButton>	arrow;
		BHolder<ISplitBoard>	board;
		BArray<BSplitItemHolder>	items;
	};
}

#endif